<!-- Select Controle Score -->
<?php
require('db.php');

$vak = $_GET['vak'];

$result = mysql_query("
SELECT l.naam, l.voornaam, k.afkorting
FROM leerling l, klas k
WHERE l.klas
IN(
	SELECT p.klasID
	FROM vakkenperklas p
	WHERE vakID = (
		SELECT id
		FROM vak
		WHERE naam = '$vak'
	)
)
AND l.klas = k.id") or die (mysql_error());

$data = array();

while ($row = mysql_fetch_object($result)) {
    $data [] = $row;
}

echo json_encode($data);
?>
